import org.restlet.data.Status;

targetIndex = Integer.valueOf(index) - 1;

if (count == 0 || targetIndex < 0 || targetIndex >= count) {
	response.setStatus(	Status.CLIENT_ERROR_NOT_FOUND);
	throw new StopException();
}